<?php

    if (!defined('EXPONENT')) exit('');
    global $db;
    $curent_loc=$loc;
    $loc_src=$loc->src;
    $curent_loc->src=$loc_src.'_news';
    $link1 = $db->selectObject('linklist_link',"location_data='".serialize($curent_loc)."' ORDER BY  post_date DESC");
    $curent_loc->src=$loc_src.'_arts';
    $link2 = $db->selectObject('linklist_link',"location_data='".serialize($curent_loc)."' ORDER BY  post_date DESC");
    $loc->src=$loc_src;
    $config = $db->selectObject("linklistmodule_config", "location_data = '".serialize($loc)."'");
    if (!isset($config->show_date))
        $config->show_date = 0;

    // date
    $link1->full_date = date("F j, Y",$link1->post_date);
    $link2->full_date = date("F j, Y",$link2->post_date);
    if($link1->sef_name=="")
        $link1->seo_link = $link1->id."_"._to_vietnamese_with_nomark($link1->name);
    else
        $link1->seo_link = $link1->id."_".$link1->sef_name;
    if($link2->sef_name=="")
        $link2->seo_link = $link2->id."_"._to_vietnamese_with_nomark($link2->name);
    else
        $link2->seo_link = $link2->id."_".$link2->sef_name;


    $template = new template('linklistmodule','_last_news',$loc);

    $template->assign('news',$link1);
    $template->assign('art',$link2);
    $template->assign('config',$config);
    $template->register_permissions(
    array('administrate','configure','create','edit','delete'   ),$loc);
    $template->output();
?>
